home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 December / MACPOWER-1997-12.ISO.7z / MACPOWER-1997-12.ISO / AMUG / PROGRAMMING / Raven 1.2.sit / Raven 1.2 / Source / Foundation / OS / ZBaseTimer.cpp next >
Text File  |  1996-10-28  |  2KB  |  82 lines

  1. /*
  2.  *  File:       ZBaseTimer.h
  3.  *  Summary:       Abstract base class for a mixin that gets periodic time.
  4.  *  Written by: Jesse Jones
  5.  *
  6.  *  Copyright ゥ 1996 Jesse Jones. 
  7.  *    For conditions of distribution and use, see copyright notice in ZTypes.h  
  8.  *
  9.  *  Change History (most recent first):    
  10.  *
  11.  *         <->     6/23/96    JDJ        Created
  12.  */
  13.  
  14. #include <ZBaseTimer.h>
  15.  
  16. #include <ZDebug.h>
  17.  
  18.  
  19. // ===================================================================================
  20. //    class MBaseTimer
  21. // ===================================================================================
  22.  
  23. //---------------------------------------------------------------
  24. //
  25. // MBaseTimer::~MBaseTimer
  26. //
  27. //---------------------------------------------------------------
  28. MBaseTimer::~MBaseTimer()
  29. {
  30. }
  31.  
  32.  
  33. //---------------------------------------------------------------
  34. //
  35. // MBaseTimer::MBaseTimer 
  36. //
  37. //---------------------------------------------------------------
  38. MBaseTimer::MBaseTimer(MilliSecond freq, bool running)                    
  39. {
  40.     ASSERT(freq >= 0);
  41.  
  42.     mTimerFreq      = freq;
  43.     mTimerIsRunning = running;
  44. }
  45.  
  46.  
  47. //---------------------------------------------------------------
  48. //
  49. // MBaseTimer::StopTimer
  50. //
  51. //---------------------------------------------------------------
  52. void MBaseTimer::StopTimer()
  53. {
  54.     mTimerIsRunning = false;
  55. }
  56.  
  57.  
  58. //---------------------------------------------------------------
  59. //
  60. // MBaseTimer::StartTimer
  61. //
  62. //---------------------------------------------------------------
  63. void MBaseTimer::StartTimer()
  64. {
  65.     mTimerIsRunning = true;
  66. }
  67.  
  68.  
  69. //---------------------------------------------------------------
  70. //
  71. // MBaseTimer::SetTimerFreq
  72. //
  73. //---------------------------------------------------------------
  74. void MBaseTimer::SetTimerFreq(MilliSecond freq)    
  75. {
  76.     ASSERT(freq >= 0); 
  77.     
  78.     mTimerFreq = freq;
  79. }
  80.  
  81.  
  82.